import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'

const routes: Array<RouteRecordRaw> = [
    {
        path: '/',
        redirect: '/intelligentDetection'
    },
    {
        path: '/index',
        name: 'Index',
        redirect: 'intelligentDetection',
        meta: {
            title: '校园概览',
            keepAlive: true,
            requireAuth: true
        },
        component:()=>import('../pages/index/index.vue'),
        children:[
            {
                path:'/intelligentDetection',
                name:'intelligentDetection',
                meta:{
                    title: '智能检测',
                    keepAlive: true,
                    requireAuth: true
                },
                component:()=>import('../pages/intelligentDetection/index.vue'),
            },
            {
                path:'/jobDirection',
                name:'jobDirection',
                meta:{
                    title: '就业态势',
                    keepAlive: true,
                    requireAuth: true
                },
                component:()=>import('../pages/jobDirection/index.vue'),
            },
            {
                path:'/safeManage',
                name:'safeManage',
                meta:{
                    title: '安防管理',
                    keepAlive: true,
                    requireAuth: true
                },
                component:()=>import('../pages/safeManage/index.vue'),
            },
            {
                path:'/equipment',
                name:'equipment',
                meta:{
                    title: '设备运维',
                    keepAlive: true,
                    requireAuth: true
                },
                component:()=>import('../pages/equipment/index.vue'),
            },
        ]
    }
]

const router = createRouter({
    history:createWebHistory(),
    routes,
})

export default router